package com.city.eduservice.controller;

import com.city.commonutils.Result;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 * User: Cheng
 * Date: 2020/5/30
 * Time: 0:11
 * Description: No Description
 */
@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin//后端解决跨域问题（跨域，1、求协议不同（http-https）2、ip地址不同 3、前端后端的端口号不同）
public class EduLoginController {
    //模拟登录
    //login
    @PostMapping("/login")
    public Result login(){
        return Result.ok().data("token","city");
    }
    //info
    @GetMapping("/info")
    public Result info(){
        return Result.ok().data("roles","[admin]").data("name","city").data("avatar","http://localhost:8001/image/defaultAvatar.jpg");
    }
}